package CommonLibrary.Commnads;


import java.util.ArrayList;
import javax.xml.bind.annotation.*;

import ClientLibrary.Board;
import CommonLibrary.Point;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "MoveRequest")
public class MoveRequest extends Command {

	@XmlElement(required = true)
    private ArrayList<Point> step;
	@XmlElement(required = true)
	private int gameId;
	@XmlElement(required = true)
	private int playerId;
	
	public MoveRequest() {
		id = 4;
	}
	
    public int getGameId() {
		return gameId;
	}

	public void setGameId(int gameId) {
		this.gameId = gameId;
	}

	public int getPlayerId() {
		return playerId;
	}

	public void setPlayerId(int playerId) {
		this.playerId = playerId;
	}

	public ArrayList<Point> getStep()
    {
        if (step == null)
        {
            step = new ArrayList<Point>();
        }
        return this.step;
    }

    public void setStep(ArrayList<Point> step)
    {
        this.step = step;
        if(Board.getBoard().getSide() == 0)
        {
            for(Point p: this.step)
            {
                p.setX(7 - p.getX());
                p.setY(7 - p.getY());
            }
        }
    }

}